<html lang="zh-cn" xmlns：th="http://www.thymeleaf.org" xmlns:th="http://www.w3.org/1999/xhtml">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>预约信息</title>
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="admin/bower_components/bootstrap/dist/css/bootstrap.min.css"
          th:href="@{/admin/bower_components/bootstrap/dist/css/bootstrap.min.css}">
</head>
<br>
<table class="table table-hover">
    <thead>
    <tr>
        <td colspan="2" style="text-align: left;width: 150px">
            <span style="font-family: '黑体'; font-size: 20px;">请输入电话号码：</span>
        </td>
        <form th:action="@{/admin/selectBookByKey}">
            <td><input type="text" class="form-control" value=""
                       id="InputUrl" name="tel" placeholder="电话号码"></td>
            <td><input class="btn" type="submit" value="查询"></td>
        </form>
    </tr>

    <tr>
        <th>#</th>
        <th>姓名</th>
        <th>房间类型</th>
        <th>联系电话</th>
        <th>入住日期</th>
        <th>离去日期</th>
        <th>价格</th>
        <th>房间号</th>
        <th style="padding-left:35px">操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="book:${bookList}">
        <td th:text="${book.id}"></td>
        <td th:text="${book.customer}"></td>
        <td th:text="${book.type}"></td>
        <td th:text="${book.tel}"></td>
        <td th:text="${#dates.format(book.startdate,'yyyy-MM-dd')}"></td>
        <td th:text="${#dates.format(book.enddate,'yyyy-MM-dd')}"></td>
        <td th:text="${book.money}"></td>
        <td th:text="${book.roomId}"></td>
        <td th:if="${book.roomId}==null" width="180px">
            <a th:href="@{/admin/bookDatail(id=${book.id})}">查看</a>&nbsp;&nbsp;
            <a th:href="@{/admin/toEditBook(id=${book.id})}">入住</a>
        </td>
        <td th:if="${book.roomId}!=null">
            <a th:href="@{/admin/bookDatail(id=${book.id})}">查看</a>&nbsp;&nbsp;
            <a th:href="@{/admin/tuifang(id=${book.id})}" onclick="return confirm('确认办理退房？')">退房</a>
        </td>
</table>

</tbody>
</table>
<div style="float: right;padding-right: 150px;">

        当前 <span th:text="${pageInfo.pageNum}"></span> 页,总 <span
            th:text="${pageInfo.pages}"></span> 页,共 <span
            th:text="${pageInfo.total}"></span> 条记录

</div><br>
<ul class="pagination" style="float: right;padding-right: 100px;">
        <li><a th:href="@{/admin/bookList}">第一页</a></li>
        <li><a th:href="@{/admin/bookList(pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}">上一页</a></li>
        <li>
            <a th:href="@{/admin/bookList(pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">下一页</a>
        </li>
        <li><a th:href="@{/admin/bookList(pageNum=${pageInfo.pages})}">最后一页</a></li>
    </ul>

</body>
</html>